package com.lovejes.cuniao.scheduling.datatransfer.dataprocesser;

import com.lovejes.cuniao.scheduling.exception.DataTransferException;


public class DataProcesserFactory {

	static class SingletonHolder {
        static DataProcesserFactory instance = new DataProcesserFactory();
    }

    public static DataProcesserFactory getInstance() {
        return SingletonHolder.instance;
    }
    
    public DataProcesser getDataAdapterImpl(String className) throws DataTransferException {
    	DataProcesser oDataProcesser = null;
        try {
            Class<?> c = Class.forName(className);
            oDataProcesser = (DataProcesser) c.newInstance();
        } catch (Exception e) {
            throw new DataTransferException(e);
        }
        return oDataProcesser;
    }
}
